//
//  MarketHeaderView.m
//  digitalCurrency
//
//  Created by 默认账户 on 2019/4/3.
//  Copyright © 2019 XinHuoKeJi. All rights reserved.
//

#import "MarketHeaderView.h"

@implementation MarketHeaderView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor colorWithHEX:@"22273B"];
        [self makeview];
    }
    return self;
}

- (void)makeview {
    
    CGFloat viewwidth = SCREEN_WIDTH-30;
    
    UIView *bgview = [[UIView alloc] initWithFrame:CGRectMake(15, 20, viewwidth, 90)];
    [self addSubview:bgview];
    bgview.backgroundColor = [UIColor whiteColor];
    bgview.layer.cornerRadius = 8;
    
    UILabel *title = [[UILabel alloc] init];
    title.textColor = [UIColor blackColor];
    title.font      = [UIFont systemFontOfSize:18];
    title.text      = LocalizationKey(@"我的矿池");
    title.textAlignment = NSTextAlignmentCenter;
    [bgview addSubview:title];
    [title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.mas_equalTo(17);
        make.width.mas_equalTo(viewwidth/2.0);
        make.height.mas_equalTo(25);
    }];
    
    UIView *line = [[UIView alloc] init];
    line.frame = CGRectMake(viewwidth/2.0 - 0.5,20,1,50);
    line.backgroundColor = [UIColor colorWithHEX:@"f5f5f5"];
    [bgview addSubview:line];
    
    UILabel *mymine = [[UILabel alloc] init];
    mymine.textColor = [UIColor blackColor];
    mymine.font      = [UIFont systemFontOfSize:14];
    mymine.text      = @"0.00";
    [bgview addSubview:mymine];
    self.mymine = mymine;
    mymine.textAlignment = NSTextAlignmentCenter;

    [mymine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.top.mas_equalTo(53);
        make.width.mas_equalTo(viewwidth/2.0);
        make.bottom.mas_equalTo(-17);
    }];
    
    UILabel *acctitle = [[UILabel alloc] init];
    acctitle.textColor = [UIColor blackColor];
    acctitle.font      = [UIFont systemFontOfSize:18];
    acctitle.text      = LocalizationKey(@"矿池收益");
    [bgview addSubview:acctitle];
    acctitle.textAlignment = NSTextAlignmentCenter;

    [acctitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(viewwidth/2.0);
        make.top.mas_equalTo(17);
        make.width.mas_equalTo(viewwidth/2.0);
        make.height.mas_equalTo(25);
    }];
    
    UILabel *mymineaccount = [[UILabel alloc] init];
    mymineaccount.textColor = [UIColor blackColor];
    mymineaccount.font      = [UIFont systemFontOfSize:14];
    mymineaccount.text      = @"0.00";
    [bgview addSubview:mymineaccount];
    mymineaccount.textAlignment = NSTextAlignmentCenter;
    self.mymineaccount = mymineaccount;

    [mymineaccount mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(viewwidth/2.0);
        make.top.mas_equalTo(53);
        make.width.mas_equalTo(viewwidth/2.0);
        make.bottom.mas_equalTo(-17);
    }];
}

@end
